<?php !defined('DYHB_PATH') && exit; /* DoYouHaoBaby Framework 模板缓存文件 生成时间：2011-05-31 16:58:11  */ ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>DoYouHaoBaby示例：表单提交、自动验证和自动填充</title>
<link rel='stylesheet' type='text/css' href='__PUBLIC__/css/common.css'>
 </head>
 <body>
 <div class="main">
 <h2>DoYouHaoBaby示例之表单处理：自动获取表单数据生成数据对象</h2>
 <div class="title">本示例对提交的表单数据进行处理，自动创建数据对象和进行自动验证和填充</div>
 <form method='post' action="<?php echo( G::U( 'index/insert' ) );?>">
 <table cellpadding=2 cellspacing=2>
 <tr>
	<td class="tRight" width="12%">标题：</td>
	<td class="tLeft" ><input type="text" name="form_title" style="height:23px" class="large bLeft"></td>
 </tr>
  <tr>
	<td class="tRight" >邮箱：</td>
	<td class="tLeft" ><input type="text" name="form_email" style="height:23px" class="large bLeft"></td>
 </tr>
 <tr>
	<td class="tRight tTop" >内容：</td>
	<td><textarea name="form_content" class="large bLeft" rows="8" cols="25"></textarea></td>
 </tr>
 <tr>
	<td></td>
	<td><input type="submit"  value="提 交"> <input type="reset" value="清 空"></td>
 </tr>
 <tr>
 </table>
 </form>
<div class="line"></div>
<div class="article_list">
<div class="title">文章列表</div>
<ul id="list">
<li>数组</li>
<?php $i=1 ;?>
<?php if( is_array( $arrList ) ) : foreach( $arrList as $key=>$value): ?>

  <li>
	<div class="article_title"><?php echo( $value['form_title'] ); ?></div><div class="article_detail">[<?php echo( $value['form_email'] ); ?> <?php echo( date( 'Y-m-d H:i:s',$value['create_date'] ) ); ?>]</div>
    <div class="content"><?php echo( $value['form_content'] ); ?></div>
  </li>

<?php $i++ ;?>
<?php endforeach;endif; ?>

<li>对象</li>
<?php $i=1 ;?>
<?php if( is_array( $arrObjectList ) ) : foreach( $arrObjectList as $key=>$value): ?>

  <li>
	<div class="article_title"><?php echo( $value->form_title ); ?></div><div class="article_detail">[<?php echo( $value->form_email ); ?> <?php echo( date( 'Y-m-d H:i:s',$value->create_date ) ); ?>]</div>
    <div class="content"><?php echo( $value->form_content ); ?></div>
  </li>

<?php $i++ ;?>
<?php endforeach;endif; ?>

</ul>

</div>

<div class="line"></div>
 <div class="title">示例源码</div><br/><div class="li_title">控制器IndexControl类</div><br/>
 <div class="code"><?php highlight_file( APP_LIB_PATH.'/Action/IndexController.class.php') ?></div><br/>
 <div class="li_title">模型FormModel类</div><br/>
 <div class="code"><?php highlight_file( APP_LIB_PATH.'/Model/FormModel.class.php') ?>
 </div>
</div>
 </body>
</html>
